#!/usr/bin/expect -f
set timeout 3
set user "root"
set passwd "p@ssword"

if {$argc == 0} {
	puts "Usage: expect script_name.sh <96.34> <passwd>"
    exit 1
}

if {$argc >= 1} {
    set ip [lindex $argv 0]
}

if {$argc >= 2} {
    set passwd [lindex $argv 1]
}

if {$argc >= 3} {
    set user [lindex $argv 2]
}

spawn ssh $user@192.168.$ip
expect "password:"
send "$passwd\r;"
interact
